<?php 
if ( $this->googleAnalyticsTrack ):

$this->jQuery()->javascriptCaptureStart();
?>
var key = '<?php echo $this->googleAnalyticsKey?>';
var domain = '<?php echo $this->googleAnalyticsDomain?>';


var _gaq = _gaq || [];
	_gaq.push(['_setAccount', key]);
	_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

$('body').ajaxComplete(function(e, xhr, settings) {
	
	var pageTracker = _gat._getTracker(key);
	
	url = settings.url.replace( domain, "ajax/");
	
    pageTracker._trackPageview( url );
});

<?php
$this->jQuery()->javascriptCaptureEnd();

endif;

